<template>
    <div class="Re_map">
        <header>
        
    
        <p class="leftReturn">
            <img class="Lo_set_back" src="../../../static/imgs/return.png">
        </p>
        <p class="center" style="font-size: 30px;">所在医院参考地图</p>
        <p></p>
    </header>
    <div style="width:750px;height:1230px;border:#ccc solid 1px;font-size:12px" id="map"></div>
    </div>
</template>
<script>
    export default {
        name:'Re_map'
    }

</script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2kv6xApA9npTfhbH7djd85Uu7zzNUvmV"></script>
<script type="text/javascript">
            $(function  () {
                $('.leftReturn').click(function  () {
                    history.back();
                })
            })
        </script>
  <script type="text/javascript">
    //创建和初始化地图函数：
    function initMap(){
      createMap();//创建地图
      setMapEvent();//设置地图事件
      addMapControl();//向地图添加控件
      addMapOverlay();//向地图添加覆盖物
    }
    function createMap(){ 
      map = new BMap.Map("map"); 
      map.centerAndZoom(new BMap.Point(116.582098,39.836481),11);
    }
    function setMapEvent(){
      map.enableScrollWheelZoom();
      map.enableKeyboard();
      map.enableDragging();
      map.enableDoubleClickZoom()
    }
    function addClickHandler(target,window){
      target.addEventListener("click",function(){
        target.openInfoWindow(window);
      });
    }
    function addMapOverlay(){
    }
    //向地图添加控件
    function addMapControl(){
      var scaleControl = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
      scaleControl.setUnit(BMAP_UNIT_IMPERIAL);
      map.addControl(scaleControl);
      var navControl = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
      map.addControl(navControl);
      var overviewControl = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:true});
      map.addControl(overviewControl);
    }
    var map;
      initMap();
  </script>

<style scoped >
    html,body{
    width:100%;
    height:100%;
  }
  header{
        display: flex;
         height: 88px;
         padding-left: 2%;
        align-items: center;
        background: url(../../../static/imgs/Reg_serve_bg01.jpg);
        justify-content: space-between;
        
    }
  div{
    
    width:100%;
    height:100%;
    
  }
  .center{
    margin-left:-40px;
  }



</style>




